Skip to content

Cleanup#3

Merged
cloether merged 3 commits intomasterfrom
feature/mypy
Feb 6, 2026
Merged

Cleanup#3
cloether merged 3 commits intomasterfrom
feature/mypy

Conversation

@cloether
Copy link
Owner

@cloether cloether commented Feb 6, 2026

This pull request introduces several improvements and updates across the codebase, focusing on modernizing Python version support, enhancing type safety, updating dependencies, and cleaning up configuration and documentation files. The most significant changes are grouped below.

Python Version and Dependency Updates:

  • Downgraded the base image in the Dockerfile from python:3.13-alpine to python:3.11-alpine to match updated compatibility requirements.
  • Updated the tox.ini configuration to add support for Python 3.10 and 3.11 test environments and changed the default coverage reporting environment to use Python 3.11. [1] [2]
  • Added a Pipfile to manage project dependencies with Pipenv and specified Python 3.11.14 as the required version.
  • Updated pytest.ini and requirements-dev.txt to require newer versions of testing and development tools, ensuring compatibility with the latest Python versions. [1] [2]

Type Hinting and Code Quality:

  • Added type annotations throughout skeleton/const.py and skeleton/error.py to improve type safety and code clarity. [1] [2] [3] [4]
  • Refactored exception classes in skeleton/error.py to use modern Python conventions and enhanced type annotations for exception construction and serialization. [1] [2]

Configuration and Cleanup:

  • Removed legacy Python 2.6 and 2.7 dependency blocks from setup.py, reflecting the project's focus on modern Python versions.
  • Removed the pull request template file .github/pull_request_template.md to streamline repository maintenance.

Script and Miscellaneous Updates:

  • Bumped the version of the depupdate.py script and simplified its argument parsing and resource management. [1] [2] [3]
  • Minor docstring and comment cleanups in setup.py for clarity.

These changes collectively modernize the codebase, improve maintainability, and ensure compatibility with current Python tooling and best practices.

Copilot AI review requested due to automatic review settings February 6, 2026 03:30
@cloether cloether merged commit 8662bbe into master Feb 6, 2026
7 checks passed
@cloether cloether deleted the feature/mypy branch February 6, 2026 03:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request attempts to modernize the Python codebase by downgrading the Docker base image from Python 3.13 to 3.11, adding support for Python 3.10 and 3.11 in tox, introducing comprehensive type annotations, and transitioning from requirements.txt to Pipfile-based dependency management. However, the PR contains several critical issues that will break the build.

Changes:

  • Downgraded Docker base image from Python 3.13 to 3.11 and updated tox configuration to add Python 3.10/3.11 test environments
  • Added comprehensive type annotations throughout skeleton/error.py and skeleton/const.py using the typing module
  • Transitioned dependency management from requirements.txt to Pipfile/Pipfile.lock and requirements-dev.txt

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Dockerfile Downgraded base image from python:3.13-alpine to python:3.11-alpine
tox.ini Added python3.10 and python3.11 test environments; changed coverage reporting to use Python 3.11
skeleton/error.py Added comprehensive type annotations; modernized exception classes with typing support
skeleton/const.py Added type annotations to all module constants
setup.py Removed legacy Python 2.6 and 2.7 dependency blocks
scripts/depupdate.py Version bump and simplified argument parsing
requirements.txt Deleted file containing runtime dependencies
requirements-dev.txt New file with development dependencies and version pins
pytest.ini Updated pytest plugin version requirements
Pipfile New file for Pipenv-based dependency management
Pipfile.lock New lock file with pinned dependency versions
.github/pull_request_template.md Removed PR template file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

DEFAULT_FILE_WRITE_MODE = "w{0}".format(DEFAULT_FILE_MODE_SUFFIX)
DEFAULT_FILE_READ_MODE = "r{0}".format(DEFAULT_FILE_MODE_SUFFIX)
DEFAULT_CHUNK_SIZE: int = 64 * 2 ** 10
DEFAULT_FILE_MODE_SUFFIX: str = "b" if sys.version_info[0] == 2 else ""
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code still checks for Python 2 compatibility (sys.version_info[0] == 2) even though the PR removes Python 2.6 and 2.7 dependency blocks from setup.py and the project now targets Python 3.11. This check should be removed or updated since Python 2 is no longer supported by the project.

Copilot uses AI. Check for mistakes.
check-manifest = "*"
coverage = "*"
pycodestyle = "*"
pytest = "*"
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a duplicate entry for "pytest" in the dev-packages section (lines 25 and 31). One of these should be removed to avoid redundancy.

Suggested change
pytest = "*"

Copilot uses AI. Check for mistakes.
@@ -1,4 +1,4 @@
FROM python:3.13-alpine
FROM python:3.11-alpine
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Dockerfile still references requirements.txt at lines 4-5, but this file is being deleted in this PR. The Dockerfile needs to be updated to use the new requirements-dev.txt file or another dependency management approach (such as Pipfile/Pipfile.lock), otherwise the Docker build will fail.

Copilot uses AI. Check for mistakes.
allow_prereleases = true # Allow pre-release versions
disable_pip_input = true # Prevent pipenv from asking for input
install_search_all_sources = true # Search all sources when installing from lock
sort_pipfile = true # Sort packages alphabeticallyy
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in line 68: "alphabeticallyy" should be "alphabetically" (with only one 'y' at the end).

Suggested change
sort_pipfile = true # Sort packages alphabeticallyy
sort_pipfile = true # Sort packages alphabetically

Copilot uses AI. Check for mistakes.
sort_pipfile = true # Sort packages alphabeticallyy

[requires]
python_version = "3.11.14"
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The python_version should specify a major.minor version (e.g., "3.11"), not a patch version (e.g., "3.11.14"). Pipenv's python_version field is intended for specifying the major.minor Python version, not the patch level. The patch version specification may cause issues with Pipenv's version matching.

Suggested change
python_version = "3.11.14"
python_version = "3.11"

Copilot uses AI. Check for mistakes.
envlist =
coverage-clean
{python2.7,python3.6,python3.7,python3.8,python3.9}
{python2.7,python3.6,python3.7,python3.8,python3.9,python3.10,python3.11}-tests
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tox environment naming is inconsistent. Line 4 adds "-tests" suffix to the new environments (python3.10-tests, python3.11-tests), but the existing environments (python2.7, python3.6, python3.7, python3.8, python3.9) don't have this suffix. This inconsistency may cause issues with tox configuration. Either all environments should have the "-tests" suffix or none should.

Suggested change
{python2.7,python3.6,python3.7,python3.8,python3.9,python3.10,python3.11}-tests
{python2.7,python3.6,python3.7,python3.8,python3.9,python3.10,python3.11}

Copilot uses AI. Check for mistakes.
Comment on lines +56 to 57
def __reduce__(self) -> Tuple[Callable[..., T], Tuple[Type[T], None, Dict[str, Any]]]:
return _err_from_packed_args, (self.__class__, None, self.kwargs)
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type annotation for reduce is incorrect. It returns a tuple containing (_err_from_packed_args, (self.class, None, self.kwargs)), but the type annotation suggests it returns Tuple[Callable[..., T], Tuple[Type[T], None, Dict[str, Any]]]. However, self.class is the actual class (type), not Type[T]. The correct return type should be Tuple[Callable[..., BaseError], Tuple[type, None, Dict[str, Any]]] or similar. Additionally, the TypeVar T is bound to BaseException but is being used here in a context where it should be bound to BaseError.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant